<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("questions.xml");

$english = $xmlDoc->getElementsByTagName("english");

$msg = "<h3>English</h3>\n";
$msg .= "<p>\n";
for ($i = 0; $i < $english->length; $i++) {
	$eval = $english->item($i)->nodeValue;
	$kval = $english->item($i)->parentNode->getElementsByTagName("korean")->item(0)->nodeValue;
	$msg .= "<a class=\"info\" href=\"#\">" . $eval . "<span>" . $kval . "</span></a><br>\n";		
}
$msg .= "</p>\n";

$korean = $xmlDoc->getElementsByTagName("korean");

$msg .= "<h3>Korean</h3>\n";
$msg .= "<p>\n";
for ($i = 0; $i < $korean->length; $i++) {
	$kval = $korean->item($i)->nodeValue;
	$eval = $korean->item($i)->parentNode->getElementsByTagName("english")->item(0)->nodeValue;
	$msg .= "<a class=\"info\" href=\"#\">" . $kval . "<span>" . $eval . "</span></a><br>\n";		
}
$msg .= "</p>\n";

echo $msg;
?>